{template 'common/header'}
<ul class="nav nav-tabs">
		<li class="active"><a href="{php echo $this->createWebUrl('print', array('op' => 'list'));}">打印机管理</a></li>
		<li><a href="{php echo $this->createWebUrl('print', array('op' => 'add'));}">设置打印机</a></li>
	</ul>
	<div style="padding:15px;">
		<table class="table table-hover table-bordered" >
			<thead class="navbar-inner">
				<tr>
					<th style="width:10px;">id</th>
					<th style="width:40px;">打印机编号</th>
					<th style="width:40px;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['id']}</td>
					<td>{$item['deviceNo']}</td>
					<td>
						<a href="JavaScript:;" data="{$item['id']}" class="del_peo"><i class="fa fa-trash-o text-sg"></i> 删除打印机 </a>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{$pager}
	</div>
<script type="text/javascript">
 $(function () {
        $(".del_peo").bind("click",function(){
            var id = $(this).attr('data');
	        var url = "{php echo $this->createWebUrl('print',array('op' => 'delete'))}";
	            $.post(url,
	            {
	                id:id
	            },
	            function(msg){
	                    if (msg.status == 1) {
	                    	setTimeout(function(){
	                        	window.location.reload();
	                   		 },100);
	                    };
	                    
	            },
	            'json');
        });
});
</script>


{template 'common/footer'}